﻿// 注释

using GeneralCommon.Models.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.EcsWeb.Service.Remote;
public interface ISignalRService
{
    public event EventHandler<string> ClosedEvent;
    public event EventHandler<string> ConnectedEvent;
    public event EventHandler<InformModel> MessageEvent;
    public event EventHandler<RemoteLog> RemoteLogEvent;

    public bool IsConnected { get; set; }
    /// <summary>
    /// 连接服务
    /// </summary>
    /// <param name="url">地址</param>
    /// <param name="user">用户</param>
    /// <returns>登录用户</returns>
    Task<bool> ConnectServer(string url, User user);
    /// <summary>
    /// 停止服务
    /// </summary>
    /// <returns></returns>
    Task<bool> StopServer();

    /// <summary>
    /// 监听信息
    /// </summary>
    /// <returns></returns>
    bool ListenMessage();
    /// <summary>
    /// 监听远程日志
    /// </summary>
    /// <returns></returns>
    bool ListenRemoteLog();


    /// <summary>
    /// 写日志
    /// </summary>
    /// <param name="log"></param>
    /// <returns></returns>
    Task<bool> WriteLog(RemoteLog log);
}

